package r5.powtorka3;

import java.text.DateFormat;
import java.util.Date;
import java.util.GregorianCalendar;

public class Employee implements Cloneable {

	private String name;
	private double salary;
	private Date hireDate;

	public Employee(String name, double salary, int year, int month, int day) {
		this.name = name;
		this.salary = salary;
		this.hireDate = new GregorianCalendar(year, month - 1, day).getTime();
	}

	public void increaseSalary(double percent) {
		this.salary += this.salary * percent / 100;
	}

	public String getName() {
		return name;
	}

	public double getSalary() {
		return salary;
	}

	public Date getHireDate() {
		return hireDate;
	}

	@Override
	public String toString() {
		return this.getClass().getSimpleName() + " " + this.name + ", salary: "
				+ this.salary + ", hired: "
				+ DateFormat.getDateInstance().format(this.hireDate);
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

}
